package com.xinhuajs.articlemg.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xinhuajs.articlemg.dao.ILoginDAO;
import com.xinhuajs.articlemg.pojo.Admin;
import com.xinhuajs.articlemg.service.ILoginService;
@Service("loginService")
public class LoginServiceImpl implements ILoginService{

	@Resource
	private ILoginDAO loginDAO;

	@Override
	public Admin admin_selectService(String adminname, String adminpwd) {
		Admin admin=new Admin();
		admin.setAdminname(adminname);
		admin.setAdminpwd(adminpwd);
		Admin admin_=loginDAO.admin_selectDAO(admin);
		
		return admin_;
	}

	@Override
	public Admin selectByIdService(int id) {
		Admin admin=new Admin();
		admin.setId(id);
		admin=loginDAO.selectByIdDAO(admin);
		return admin;
	}

	@Override
	public void updatePwdByIdService(int id,String newPwd) {
		Admin admin=new Admin();
		admin.setId(id);
		admin.setAdminpwd(newPwd);
		loginDAO.updatePwdByIdDAO(admin);
		
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
}


















